package br.com.clinica.supercao.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Transient;

import br.com.clinica.supercao.entity.domain.EnumTipoAnimal;

@Entity
@Table(name="VETERINARIO",schema="clinica")
@PrimaryKeyJoinColumn(name="SEQ_VETERINARIO")
public class Veterinario extends Pessoa {
	private static final long serialVersionUID = 1L;
	
	private Integer crmv;
	private EnumTipoAnimal tipoAnimalTrata;
	private List<Consulta> consultas;
	@Column(name="NUM_CRMV",unique=true)
	public Integer getCrmv() {
		return crmv;
	}
	public void setCrmv(Integer crmv) {
		this.crmv = crmv;
	}
	@Enumerated(value=EnumType.STRING)
	@Column(name="TIPO_ANIMAL_TRATA",length=255)
	public EnumTipoAnimal getTipoAnimalTrata() {
		return tipoAnimalTrata;
	}
	public void setTipoAnimalTrata(EnumTipoAnimal tipoAnimalTrata) {
		this.tipoAnimalTrata = tipoAnimalTrata;
	}
	@OneToMany(mappedBy="veterinario",fetch=FetchType.EAGER)
//	@Transient
	public List<Consulta> getConsultas() {
		return consultas;
	}
	public void setConsultas(List<Consulta> consultas) {
		this.consultas = consultas;
	}
	@Transient
	public List<EnumTipoAnimal> getTipos(){
		return EnumTipoAnimal.getList();
	}
}
